package com.xshang.service.combine.impl;

import com.xshang.entity.bo.HeadLine;
import com.xshang.entity.bo.ShopCategory;
import com.xshang.entity.dto.MainPageInfoDTO;
import com.xshang.entity.dto.Result;
import com.xshang.service.combine.HeadLineShopCategoryCombineService;
import com.xshang.service.solo.HeadLineService;
import com.xshang.service.solo.ShopCategoryService;
import org.simplespringframework.annotation.Service;
import org.simplespringframework.inject.annotation.Autowired;

import java.util.List;

/**
 * @BelongsProject: simpleframework
 * @BelongsPackage: com.xshang.service.combine.impl
 * @Author: xshang
 * @CreateTime: 2023-06-23  17:33
 * @Description: TODO
 * @Version: 1.0
 */
@Service
public class HeadLineShopCategoryServiceImpl implements HeadLineShopCategoryCombineService {

    @Autowired
    private HeadLineService headLineService;

    @Autowired
    private ShopCategoryService shopCategoryService;

    @Override
    public Result<MainPageInfoDTO> getMainPageInfo() {
        // 获取头条列表
        Result<List<HeadLine>> headLineListResult = headLineService.queryHeadLine(null, 1, 4);
        // 获取店铺类别列表
        Result<List<ShopCategory>> shopCategorylistResult = shopCategoryService.queryShopCategory(null, 1, 100);
        // 合并--> return
        return mergeMainPageInfoResult(headLineListResult, shopCategorylistResult);
    }

    private Result<MainPageInfoDTO> mergeMainPageInfoResult(Result<List<HeadLine>> headLineListResult, Result<List<ShopCategory>> shopCategorylistResult) {
        return null;
    }
}
